package br.perfiman.faces;

import br.perfiman.model.Account;
import br.perfiman.service.AbstractService;
import br.perfiman.service.AccountService;
import br.perfiman.utils.ServiceLocator;

public class AccountBean extends AbstractBean<Account>{

	public AccountBean() throws Exception {
		super();
		if(getEntity() == null)
			setEntity(new Account());
		retrieveAll();
	}
	
	@Override
	@SuppressWarnings("unchecked")
	protected AbstractService<Account> getService() throws Exception {
		AccountService ac = null;
		if(service == null){
			ac = (AccountService) ServiceLocator.getInstance().get("AccountServiceBean/remote");
			service = (AbstractService<Account>) ac;
		}
		return service;
	}
}
